package com.siemens.industrial.web.mvc.service.partner;

import com.siemens.industrial.model.partner.DeviceEventRelation;
import com.siemens.industrial.utils.GlobalResponseCode;
import com.siemens.industrial.utils.SiemensException;
import com.siemens.industrial.web.mvc.dao.partner.PartnerDeviceEventRelationDao;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by qupen on 2016/8/31.
 */
@Service
public class PartnerSubscriptionService {
    @Resource
    PartnerDeviceEventRelationDao partnerDeviceEventRelationDao;

    public DeviceEventRelation getDeviceEventRelation(String tenantId, String deviceId, String eventId) {
        return partnerDeviceEventRelationDao.getDeviceEventRelation(tenantId, deviceId, eventId);
    }

    public List<DeviceEventRelation> getDeviceEventRelations(String tenantId) {
        return partnerDeviceEventRelationDao.getDeviceEventRelations(tenantId);
    }

    public List<DeviceEventRelation> getDeviceEventRelationsByDevice(String tenantId, String deviceId) {
        return partnerDeviceEventRelationDao.getDeviceEventRelationsInDevice(tenantId, deviceId);
    }

    public List<DeviceEventRelation> getDeviceEventRelationsByEvent(String tenantId, String eventId) {
        return partnerDeviceEventRelationDao.getDeviceEventRelationsInEvent(tenantId, eventId);
    }
}
